Project 12

Interfacing through Web Application: Using ESP32 Chip & its Wi-Fi Module to Control Output Devices

  • Core features:
  • For my project, I used a 38 pinout ESP32 board although it has SEVERAL VERSIONS WITH THEIR CORRESPONDING PINOUTS: 30 pins, 36 pins, 38 pins and so on.. Interestingly, ESP-wroom-32 has been quite popular for IoT applications as it has on-chip WiFi and Bluetooth module, making it quite useful for embedded systems. Also, the ESP32 dev board has a built-in USB to UART controller. So, it is not needed to use a stand-alone USB to TTL converter controller to flash the ESP32 board. The board can integrate touch sensors and has 2 UART communication channels and 18 ADC (Analog to Digital Convert) channels. An illustration for pinout for 36 pins are given below with 18 pins on each side, and where 34 pins are used for GPIO (General Purpose Input Output) pins.

  • Driver installation & flashing the board:
  • To use the board using ARDUINO IDE, it is necessary to download a driver. It could be either CH340 or CP210x chip. To find out, which one the board use, it is necessary to explore its datasheet. Alternatively, it could be also seen in the board in one of the chips mounted on it. For my board, it recognizes the CH340 driver, which was downloaded and installed from https://sparks.gogo.co.nz/ch340.html

    I want to always check out the blinking LED to make sure my sketch is working and the correct driver has been successfully installed to be communicated through the IDE. In, ESP32, the LED is connected to PIN 2. So, I uploaded the sketch by declaring the LED pin accordingly, i.e., “int LED_BUILTIN = 2”. In my MAC ESP32 Wrover Kit (All version) board was selected from the BOARD MANAGER of IDE. Separately, I used 3 more LEDs in my PINs 2, 4, and 16, respectively.



  • “Reset” button (EN button) press and correct “Baud” rate selection from serial monitor:
  • After uploading the sketch, the serial monitor could be opened to see the “Wi-Fi” connectivity status of the ESP32. However, it would not show anything at a baud rate of 9600; the monitor only displays data at a baud rate of 115200. I used my personal hotspot “IIS iPhone” and its corresponding password. Once the Wi-fi connection was made, I received the IP address (***……), which I pasted on my search engine of my cell phone as well as my MacBook. It led me the web server to control my LEDs wirelessly from the server page. Using the interface page, I successfully controlled (ON/OFF) the three LEDs. The sketch for this program was retrieved from a YouTube tutorial with slight modification, including adjusting the pinouts: www.youtube.com/watch?v=yIYI1XW4ALg&ab_channel=MicrocontrollersLab



    Video clips:



  • Sketch:


  • Retrieved from "https://www.youtube.com/watch?v=yIYI1XW4ALg&ab_channel=MicrocontrollersLab". However, the wifi network name, password, and pinouts were adjusted according to my network and circuit design features.